{extend name="base" /}
 {block name="body"}
	<!--headlogo start-->
    <div class="head_logo">
    	<img src="__STATIC__/zjs/images/bg_logo_02.jpg" alt="" width="100%">
    </div>
    <!--headlogo end-->
    <!--个人中心 绑定 start-->
    <div class="binding">
        <h3>推荐顾客和个人中心需要先绑定后才能访问！</h3>
    	<div class="binding_head">
    		<img src="__STATIC__/zjs/images/r_icon_11.png" alt="">
    		<span class="binding_title">电话<small>（Phone）</small></span>
    	</div>
        <form method="post" class="binding_form" action="{:url('publics/validates')}" id="form1">
            <input class="binding_phone" type="text" placeholder="必填" name="phone">
            <div class="label_div">
                <!--<label class="customer_radio a"><input type="radio" name="attr" value="153" checked="checked">顾客</label>-->
                <label class="staff_radio a"><input type="radio" name="attr" value="154" checked="checked">员工</label>
            </div>
            <button class="btn_submit btn_binding" type="button" id="button">绑定</button>
        </form>
    	<div>
    		<img src="__STATIC__/zjs/images/r_bg_02.jpg" alt="" width="100%">
    	</div>
    </div>
    <!--个人中心 绑定 end-->
    {/block}
    {block name="js"}
        <script src="__STATIC__/zjs/layer/mobile/layer.js" type="text/javascript"></script>
{/block}
    {block name="script"}
        <script type="text/javascript">
		$(function(){
                $('input[name="attr"]:checked').css({"background":"url(__STATIC__/zjs/images/check_07.png)","background-size":"25px 26px"});
                $(".customer_radio").click(function(){
                        $(this).children("input").css({"background":"url(__STATIC__/zjs/images/check_07.png)","background-size":"25px 26px"});
                        $(this).siblings("label").children("input").css({"background":"url(/static/zjs/images/check_09.png)","background-size":"25px 26px"});
                });
                $(".staff_radio").click(function(){
                        $(this).children("input").css({"background":"url(__STATIC__/zjs/images/check_07.png)","background-size":"25px 26px"});
                        $(this).siblings("label").children("input").css({"background":"url(__STATIC__/zjs/images/check_09.png)","background-size":"25px 26px"});
                });
            $("#button").click(function(){
                $(this).hide();
                var a =layer.open({
                    type:2,
                    content:"请求中...."
                });
                $.ajax({
                    url:"{:url('publics/validates')}",
                    type: "post",
                    data: $("#form1").serialize(),
                    success: function (info) {
                        if (info.code === 1) {
                            setTimeout(function () {
                                location.href = info.url;
                            }, 1000);
                        }
                        layer.close(a);
                        layer.open({
                            content: info.msg
                            ,skin: 'msg'
                            ,time: 2 //2秒后自动关闭
                        });
                        $("#button").show();
                    }
                });
                return false;
            });
		})
	</script>
    {/block}